#define _CRT_SECURE_NO_WARNINGS 1
#include"sort.h"
void insertsort(int* a, int n) {
	//[0,end] end+1
	/*int length = sizeof(a) / sizeof(a[0]);*/
	for (int i = 0; i < n-1; i++) {
		int end=i;
		int tmp = a[end + 1];
		while (end >= 0) {
			if (tmp < a[end]) {
				a[end + 1] = a[end];
				--end;
			}
			else {
				break;
			}
		}
		a[end + 1] = tmp;
	}
	
}
void printfsort(int* a, int n) {
	for (int j =0; j < n; j++) {
		printf("%d ", a[j]);
	}
}